package com.ehome.poct.core.api.dto.order;

import com.ehome.core.entity.DTO;
import com.ehome.poct.core.api.constant.enums.ScanTypeEnums;
import com.ehome.poct.core.api.dto.groups.ValidationGroups;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @auther: kuiba.peng
 * @date: 2022/11/22 14:49
 * @description:
 */
@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class UnificationPayReqDTO extends DTO {

    @ApiModelProperty("条码")
    @NotBlank(message = "authCode不能为空", groups = ValidationGroups.FirstGroups.class)
    private String authCode;

    @ApiModelProperty("条码")
    @NotNull(message = "scanType不能为空")
    private ScanTypeEnums scanType;

    @ApiModelProperty("检测订单号")
    @NotBlank(message = "orderNo不能为空")
    private String orderNo;

    @NotNull(message = "订单描述不能为空")
    private String description;

    @NotNull(message = "收银台展示名不能为空")
    private String showName;

    @NotNull(message = "支付金额不能为空")
    @Min(value = 1L, message = "支付金额不能小于1（分）")
    private Long payMoney;

    @NotBlank(message = "支付回调地址不能为空")
    private String payNotifyUrl;

    /**
     * 最晚允许的付款时间
     */
    private String timeoutExpress;

    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @Valid
    @NotEmpty(message = "检测项不能为空")
    private List<TestOrderItemDTO> orderItemList;

    @Valid
    @NotEmpty(message = "分润信息不能为空")
    private List<TestPoctProfitsRecordDTO> profitsRecordList;
}
